import request from "@/utils/request";

export function getAccounts(paramters) {
  return request({
    url: "api/v1/accounts/all",
    method: "get",
    params: paramters,
    authServer: false,
  });
}

export function getAccount(id) {
  return request({
    url: "api/v1/accounts/"+id,
    method: "get",
    authServer: false,
  });
}

export function addAccount(data) {
  return request({
    url: "api/v1/accounts",
    method: "post",
    data: data,
    authServer: false,
  });
}

export function updateAccount(data) {
  return request({
    url: "api/v1/accounts",
    method: "put",
    data: data,
    authServer: false,
  });
}

export function deleteAccount(id) {
  return request({
    url: "api/v1/accounts/" + id,
    method: "delete",
    authServer: false,
  });
}

export function getDimensions(paramters) {
  return request({
    url: "api/v1/dimensions",
    method: "get",
    params: paramters,
    authServer: false,
  });
}

export function getDimension(id) {
  return request({
    url: "api/v1/dimensions/" + id,
    method: "get",
    authServer: false,
  });
}

export function addDimension(data) {
  return request({
    url: "api/v1/dimensions",
    method: "post",
    data: data,
    authServer: false,
  });
}

export function updateDimension(data) {
  return request({
    url: "api/v1/dimensions",
    method: "put",
    data: data,
    authServer: false,
  });
}

export function deleteDimension(id) {
  return request({
    url: "api/v1/dimensions/" + id,
    method: "delete",
    authServer: false,
  });
}

export function disableDimension(id, activated) {
  return request({
    url: "api/v1/dimensions/" + id + "/status",
    method: "put",
    data: { activated: activated },
    authServer: false,
  });
}
